package org.fiel.struts.actions;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import org.fiel.FielConstants;
import org.fiel.torque.Informacion;
import org.fiel.torque.InformacionPeer;

/**
 * @author Luis Pablo Gallo (luispablo.gallo@gmail.com)
 */
public class InformacionAction extends DispatchAction
{
    private static Logger logger = Logger.getLogger(InformacionAction.class);
    
    public void metodoQueNoHaceNada()
    {
        
    }
    
    public ActionForward listArticulosDiario( ActionMapping mapping
                                            , ActionForm form
                                            , HttpServletRequest request
                                            , HttpServletResponse response )
    throws Exception
    {
        List<Informacion> publicaciones = InformacionPeer.retrieveByCodigo(FielConstants.CODIGO_ARTICULOS_DE_DIARIO);
        
        request.setAttribute(FielConstants.PUBLICACIONES, publicaciones);
        
        return mapping.findForward(FielConstants.SHOW_ARTICULOS_LIST);
    }
    
}